import api from '@/service/config/api.js'
export default {
	data() {
		return {
			cateList: [],
			currentType: 0,
		}
	},
	methods: {
		getCateList() {
			api.get('/goods/api/product/getTypeList', {
				id: 0
			}, {
				noHideLoading: true
			}).then(res => {
				if (res.data && res.data.length) {
					res.data.unshift({
						typeName: '精选'
					})
				}
				this.cateList = res.data
			})
		},
		handleGoodsType({
			id
		}) {
			if (id) {
				this.$set(this.params, 'productTypeId', id)
			} else {
				this.$delete(this.params, 'productTypeId')
			}
			this.noHideLoading = false
			this.getData(true)
		},
	}
}